home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / gnuplot / term / dxy.trm < prev    next >
Text File  |  1993-09-15  |  2KB  |  130 lines

  1. /*
  2.  * $Id: dxy.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT - dxy.trm */
  7. /*
  8.  * Copyright (C) 1990 - 1993   
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software  is provided "as is" without express or implied warranty.
  21.  * 
  22.  * This file is included by ../term.c.
  23.  *
  24.  * This terminal driver supports:
  25.  *  Roland DXY800A plotter 
  26.  *
  27.  * AUTHORS
  28.  *  Martin Yii, eln557h@monu3.OZ
  29.  *  Further modified Jan 1990 by Russell Lang, rjl@monu1.cc.monash.oz
  30.  * 
  31.  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  32.  * 
  33.  */
  34.  
  35. #define DXY_XMAX 2470
  36. #define DXY_YMAX 1700
  37.  
  38. #define DXY_XLAST (DXY_XMAX - 1)
  39. #define DXY_YLAST (DXY_XMAX - 1)
  40.  
  41. #define DXY_VCHAR    (56)    /* double actual height of characters */
  42. #define DXY_HCHAR    (28)    /* actual width including spacing */
  43. #define DXY_VTIC    (28)        
  44. #define DXY_HTIC    (28)        
  45.  
  46. int dxy_angle = 0;
  47.  
  48. DXY_init()
  49. {
  50. /*
  51.     No initialisation sequences for DXY 800A
  52. */
  53. }
  54.  
  55.  
  56. DXY_graphics()
  57. {
  58.     /* HOME, Character size 3 */
  59.     fprintf(outfile,"H\nS3\n");
  60. }
  61.  
  62.  
  63. DXY_text()
  64. {
  65. /*
  66.     No sequences needed
  67. */
  68. }
  69.  
  70.  
  71. DXY_linetype(linetype)
  72. int linetype;
  73. {
  74.     /* select pen */
  75.     fprintf(outfile,"J%d\n",(linetype+2)%8+1);
  76.     switch(linetype) {
  77.        case -1 :  /* use dotted line for axis */
  78.                fprintf(outfile,"L1\nB50\n");
  79.             break;
  80.        default :  /* use solid line for all others */
  81.             fprintf(outfile,"L0\n");
  82.                 break;
  83.        }
  84. }
  85.  
  86.  
  87. DXY_move(x,y)
  88. int x,y;
  89. {
  90.     fprintf(outfile,"M%d,%d\n",x,y);
  91. }
  92.  
  93.  
  94. DXY_vector(x,y)
  95. int x,y;
  96. {
  97.     fprintf(outfile,"D%d,%d\n",x,y);
  98. }
  99.  
  100.  
  101. DXY_put_text(x,y,str)
  102. int x, y;
  103. char *str;
  104. {
  105.     if (dxy_angle == 1 ) 
  106.         /* vertical */
  107.         DXY_move(x + DXY_VCHAR/4,y);
  108.     else
  109.         /* horiz */
  110.         DXY_move(x,y - DXY_VCHAR/4);
  111.     fprintf(outfile,"P%s\n",str);
  112. }
  113.  
  114.  
  115. int DXY_text_angle(ang)
  116. int ang;
  117. {
  118.     dxy_angle = ang;
  119.     fprintf(outfile,"Q%d\n",ang);
  120.     return TRUE;
  121. }
  122.  
  123.  
  124. DXY_reset()
  125. {
  126.     /* Home pen */
  127.     fprintf(outfile,"H\n");
  128. }
  129.  
  130.